package com.qiaoba.module.demo.controller;

import com.qiaoba.common.base.entity.Result;
import com.qiaoba.mq.rabbit.RabbitMqSender;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * RabbitMqController
 *
 * @author ailanyin
 * @date 2023-09-03 19:02:43
 */

@RestController
@RequestMapping("/demo/rabbit-mq")
@RequiredArgsConstructor
public class RabbitMqController {

    private final RabbitMqSender rabbitMqSender;

    @GetMapping("/send-msg")
    public Result sendMsg() {
        rabbitMqSender.sendMessage("", "test", "Hello RabbitMQ");
        return Result.success();
    }
}
